﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Lib.Data;
using Lib.Utils;

namespace MS.INV.Reports
{
    public partial class Lst_PhieuXuat : Lib.Bases.Forms.BaseForm
    {
        public Lst_PhieuXuat()
        {
            InitializeComponent();

            dtMonth.EditValue = DateTime.Now;
        }

        private void Lst_PhieuXuat_Load(object sender, EventArgs e)
        {

        }

        private void btRef_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                grid.DataSource = DBLayer.ExecDataTable("rpt_Thang_PhieuXuat", "Thang", Convert.ToDateTime(dtMonth.EditValue));
            }
            catch (Exception ex)
            {
                Lib.Bases.SysError.RaiseError(ex, this.Name, "Load data");
            }
        }

        private void btClose_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            this.Close();
        }

        private void btPr_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Lib.Bases.Reports.ShowReport("Xuat_Tk_Thang.repx", grid.GetFilteredDataSource(), "Thang", Convert.ToDateTime(dtMonth.EditValue).ToString("MM/yyyy"));
        }
    }
}
